/**
 * \* Created with IntelliJ IDEA.
 * \* User: 冯若航
 * \* Date: 2021/6/18
 * \* Time: 21:04
 * \* To change this template use File | Settings | File Templates.
 * \* Description:
 * \
 */
public class test1 {
    public static void main(String[] args) {
        Person test=new Person();
        test.setAge(11);
        test.setName("");
        System.out.println(test.getName());
        System.out.println(test.getAge());
    }
}
class Person{
    private int age;
    private String name;

    public int getAge() {
        return age;
    }

    public void setAge(int age){
        if(age<0||age>100){
            throw new IllegalArgumentException("invalid age value");
        }
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name)  {
        if(name==""){
            throw new IllegalArgumentException("不能为空");
        }
        this.name = name;
    }

}